const express = require('express');
const { buileschema } = require('graphql');
const graphqlHTTP = require('express-graphql');

const schema = buileschema(`
    type  Query {
        hello: String
    }
`)

const root = {
    hello: () => {
        return 'hello world';
    }
}

const app = express();
app.use('/graphql', graphqlHTTP({
    schema:schema,
    rootvalue: root,
    graphiql: true
}))

app.listen(3000);